<h4>Área de Status</h4>

<div>
    <ul id="browser" class="filetree">
        <?php
        $sql_raiz = "SELECT * FROM cissarea WHERE status='1' AND cis_are_id2='0' ORDER BY cis_are_nome";
        $res_raiz = sql($sql_raiz);
        while($linha_raiz = mysql_fetch_array($res_raiz)) {
        ?>
        <li class="expandable">  
            <span class="folder"><a href='?titulo=<?=$titulo;?>&cis_are_id=<?=$linha_raiz['cis_are_id'];?>' target="_self"><?=$linha_raiz['cis_are_nome'];?></a></span>
            <ul>
                <?php
                $sql_sub2 = "SELECT * FROM cissarea WHERE status='1' AND cis_are_id2='{$linha_raiz['cis_are_id']}' ORDER BY cis_are_nome";
                $res_sub2 = sql($sql_sub2);
                while($linha_sub2 = mysql_fetch_array($res_sub2)) {
                ?>
                <li>
                    <span class="folder"><a href='?titulo=<?=$titulo;?>&cis_are_id=<?=$linha_sub2['cis_are_id'];?>' target="_self"><?=$linha_sub2['cis_are_nome'];?></a></span>
                    <ul>
                        <?php
                        $sql_sub3 = "SELECT * FROM cissarea WHERE status='1' AND cis_are_id2='{$linha_sub2['cis_are_id']}' ORDER BY cis_are_nome";
                        $res_sub3 = sql($sql_sub3);
                        while($linha_sub3 = mysql_fetch_array($res_sub3)) {
                        ?>
                        <li><span class="folder"><a href='?titulo=<?=$titulo;?>&cis_are_id=<?=$linha_sub3['cis_are_id'];?>' target="_self"><?=$linha_sub3['cis_are_nome'];?></a></span></li>
                        <? 
                        }
                        ?>
                    </ul>
                </li>
                <?  
                } 
                ?>  
            </ul> 
        </li>
        <?php
        }
        ?>
    </ul>
</div>